import request from '../request'

// 获取会员信息
export function getMembershipInfo() {
  return request({
    url: '/membership',
    method: 'get'
  })
}

// 升级会员
export function upgradeMembership(data) {
  return request({
    url: '/membership/upgrade',
    method: 'post',
    data
  })
}

// 获取会员套餐列表
export function getMembershipPlans() {
  return request({
    url: '/membership/plans',
    method: 'get'
  })
}

// 获取支付记录
export function getPaymentHistory(params) {
  return request({
    url: '/membership/payments',
    method: 'get',
    params
  })
}

// 获取会员权益列表
export function getMembershipBenefits() {
  return request({
    url: '/membership/benefits',
    method: 'get'
  })
}

// 获取会员等级列表
export function getMembershipLevels() {
  return request({
    url: '/membership/levels',
    method: 'get'
  })
}

// 获取会员统计数据
export function getMembershipStats() {
  return request({
    url: '/membership/stats',
    method: 'get'
  })
}

// 获取会员邀请记录
export function getInviteHistory(params) {
  return request({
    url: '/membership/invites',
    method: 'get',
    params
  })
}

// 生成邀请链接
export function generateInviteLink() {
  return request({
    url: '/membership/invite/link',
    method: 'post'
  })
}

// 获取会员优惠券列表
export function getMembershipCoupons() {
  return request({
    url: '/membership/coupons',
    method: 'get'
  })
}

// 使用优惠券
export function useCoupon(couponId) {
  return request({
    url: `/membership/coupons/${couponId}/use`,
    method: 'post'
  })
} 